# -*- coding: utf-8 -*-
# conn_oracle create by kumiler
# on 2023/4/23 15:06
# desc
#
# import cx_Oracle
# class OracleConnector:
#     def __init__(self,ip:str,port:str,user:str,pwd:str,sname='pdb'):
#         self.dsn=cx_Oracle.makedsn(ip, port, service_name=sname)
#         self.user = user
#         self.password = pwd
#         self.sname= sname
#         self._conn = None
#     def get_conn(self,user: str,pwd:str):
#         return cx_Oracle.Connection(user=user, password=pwd, dsn=self.dsn)
#     def execute(self, query: str,conn:cx_Oracle.connect, params=None):
#         with conn.cursor() as cursor:
#             if params is None:
#                 cursor.execute(query)
#             else:
#                 cursor.execute(query, params)
#             return cursor.fetchall()
#     def drop(self,conn:cx_Oracle.Connection,db:str,tbl_name:str,p_col:str, parts:str):
#         # 备份指定分区的数据:1、清空历史备份表；2、写入要删除的备份数据
#         with conn.cursor() as cursor:
#             for p in parts.split(","):
#                 drop_query = f"""alter table sys_agency_area_manager drop partition {p} update global indexes"""
#                 print(f"""query {drop_query}""")
#                 cursor.execute(drop_query)
#             conn.commit()


